load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
load("//build:STRINGER.bzl", "stringer")

go_library(
    name = "privilege",
    srcs = [
        "kind.go",
        "privilege.go",
        "target_object_type.go",
    ],
    importpath = "github.com/cockroachdb/cockroach/pkg/sql/privilege",
    visibility = ["//visibility:public"],
    deps = [
        "//pkg/sql/pgwire/pgcode",
        "//pkg/sql/pgwire/pgerror",
        "@com_github_cockroachdb_errors//:errors",
        "@com_github_cockroachdb_redact//:redact",
        "@com_github_cockroachdb_redact//interfaces",
    ],
)

go_test(
    name = "privilege_test",
    size = "small",
    srcs = [
        "main_test.go",
        "privilege_test.go",
    ],
    deps = [
        ":privilege",
        "//pkg/util/leaktest",
        "//pkg/util/log",
        "@com_github_cockroachdb_redact//:redact",
        "@com_github_stretchr_testify//require",
    ],
)
